package com.grad.why.studentsystem.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.grad.why.studentsystem.domain.current.CurrentStudentScoresInfo;
import com.grad.why.studentsystem.mapper.ChooseCourseMapper;
import com.grad.why.studentsystem.service.StudentScoreService;
import com.grad.why.studentsystem.service.StudentarrivedinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Component
@Service(interfaceClass = StudentScoreService.class)
@Transactional
public class StudentScoreServiceImpl implements StudentScoreService {
    @Autowired
    private ChooseCourseMapper chooseCourseMapper;


    @Override
    public List<CurrentStudentScoresInfo> getStudentScoresListById(Integer id,Integer offset,Integer limit) {
        try{
            return chooseCourseMapper.getStudentScoresListById(id,offset,limit);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public int getStudentInfoByStudentName(String sname) {
        try{
            return chooseCourseMapper.getStudentInfoByStudentName(sname);
        }catch (Exception e){
            e.printStackTrace();
        }
        return 0;
    }

    @Override
    public List<CurrentStudentScoresInfo> getStudentScoreByStudentName(String sname, Integer offset, Integer limit) {
        try{
            return chooseCourseMapper.getStudentScoreByStudentName(sname,offset,limit);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public long getStudentScoresListByIdLength(Integer search) {
        try{
            return chooseCourseMapper.getStudentScoresListByIdLength(search);
        }catch (Exception e){
            e.printStackTrace();
        }
        return 0;
    }

    @Override
    public long getStudentScoreByStudentNameLength(String search) {
        try{
            return chooseCourseMapper.getStudentScoreByStudentNameLength(search);
        }catch (Exception e){
            e.printStackTrace();
        }
        return 0;
    }
}
